#ifndef TERMINATE
#define TERMINATE

#include "kernel/buffer.h"
#include "kernel/tty.h"
#include <QWidget>
#include <QPainter>

#define TTY_NUM 8

typedef Teletype* TTYLIST;

class Terminate : public QWidget{
    Q_OBJECT

public :
    explicit Terminate(QWidget *parent = 0);
    Teletype * GetTty();
    ~Terminate();

protected:
    void paintEvent(QPaintEvent *);
    void keyPressEvent(QKeyEvent  *event);
    bool eventFilter(QObject *, QEvent *);

private:
    void drawCursor(QPainter* painter);
    void initTtyList();
    QPainter *painter;
    TTYLIST ttyList[TTY_NUM];
    Teletype * curTty;
    Boolean isCursorShow;
    int cursorHeight;
    int cursorWidth;

private slots:
    void updateCursor();

};

#endif // TERMINATE

